"use strict";

module.exports = (sequelize, DataTypes) =>
  sequelize.define(
    "role",
    {
      id: {
        type: DataTypes.BIGINT(11),
        autoIncrement: true,
        primaryKey: true,
        unique: true,
        commit: "the roler id"
      },
      roleName: {
        type: DataTypes.STRING,
        field: "role_name",
        commit: "the roler name",
        validate: {
          notEmpty: true
        }
      },
      description: {
        type: DataTypes.STRING,
        field: "role_description",
        commit: "description",
        defaultValue: "non"
      }
    },
    {
      underscored: true,
      timestamp: false,
      freezeTableName: true,
      tableName: "role",
      charset: "utf8",
      collate: "utf8_general_ci"
    }
  );
